using System;
using System.Collections;
using System.Collections.Generic;
using FrameWork;
using TMPro;
using UnityEngine;

public class TimeView : MonoBehaviour
{
    [SerializeField] private TMP_Text day;
    [SerializeField] private TMP_Text year;
    [SerializeField] private TMP_Text season;
    [SerializeField] private TMP_Text weekday;
    [SerializeField] private TMP_Text hour;


    public void UpdateInfo(TimeDataSO timeData)
    {
        day.text = $"第{timeData.CurrentDay}天";
        year.text = $"第{timeData.CurrentYear}年";
        hour.text = $"{timeData.CurrentHour}时";

        switch (timeData.CurrentSeason)
        {
            case 1:
                season.text = "春";
                break;
            case 2:
                season.text = "夏";
                break;
            case 3:
                season.text = "秋";
                break;
            case 4:
                season.text = "冬";
                break;
            default:
                season.text = "春";
                break;
        }
        
        switch (timeData.CurrentDayOfWeek)
        {
            case 1:
                weekday.text = "星期一";
                break;
            case 2:
                weekday.text = "星期二";
                break;
            case 3:
                weekday.text = "星期三";
                break;
            case 4:
                weekday.text = "星期四";
                break;
            case 5:
                weekday.text = "星期五";
                break;
            case 6:
                weekday.text = "星期六";
                break;
            case 0:
                weekday.text = "星期日";
                break;
            default:
                weekday.text = "星期一";
                break;
        }
    }
}
